package main

import (
	"fmt"
	"net/http"

	"../job/pkg/settings"
	"../job/routers"
	"../job/pkg/utils"
)

func main() {
	configPath := "src/job/conf/app.ini"
	router := routers.InitRouter()
	settings.SetUp(configPath)
	go utils.CronSetUp()

	s := &http.Server{
		Addr:           fmt.Sprintf(":%d", settings.ServerSetting.HttpPort),
		Handler:        router,
		ReadTimeout:    settings.ServerSetting.ReadTimeOut,
		WriteTimeout:   settings.ServerSetting.WriteTimeOut,
		MaxHeaderBytes: 1 << 20,
	}
	s.ListenAndServe()


}
